<?php if (!defined('MAX_ON')){echo "<h1>ACCESS DENIED</h1>You cannot access this file directly.";exit();} ?>
<?php if ($template_hook=='start'){ ?>
<?php }elseif ($template_hook=='2'){ ?>
		<!-- new topic form -->
		<table class="forum-board-forum-head" cellpadding="0" cellspacing="0">
			<tr>
				<td class="forum-topic-subject"><?php echo $lang['newpost_heading']; ?></td>
				<td class="h_right"></td>
			</tr>
		</table>
		<table class="forum-jump" cellpadding="0" cellspacing="0">
			<tr>
				<td class="forum-jump-content" style="width:100%;">
					<form id="postcontent" method="post" name="postcontent" action="<?php echo max_link("index.php?func=newpost","newpost"); ?>">
						<table class="forum-jump" cellpadding="0" cellspacing="0">
							<tr>
								<td class="forum-jump-content" style="width:100%;">
									<div style="padding-<?php echo $lang['header_right']; ?>:70px;">
										<strong><?php echo $lang['newpost_subject']; ?></strong>
										<br />
										<input type="text" name="subject" size="50" value="" maxlength="50" tabindex="1" />
										<br />
										<strong><?php echo $lang['newpost_description']; ?></strong>
										<br />
										<input type="text" name="description" size="50" value="" tabindex="2" />
										<br />
									</div>
								</td>
							</tr>
						</table>
						<div class="smilies">
							<div class="smilies-header"></div>
							<div class="smilies-content">
								<?php include "includes/forums/smilies_insert.php"; ?>
								<br />(<a href="javascript:SmiliesPopUp('<?php echo "$max_domain"; ?>/includes/forums/smilies_popup.php')"><?php echo $lang['addreply_emoticons']; ?></a>)
							</div>
						</div>
						<div class="textarea-addreply">
				<!--//Editor -->
				<textarea style="visibility:hidden;position:absolute;top:0;left:0;" name="content" id="content" rows="1" cols="1" tabindex="2"></textarea>
				<input name="site_url" id="site_url" value="<?php echo "$max_domain"; ?>" type="hidden" />
				<script language="JavaScript" type="text/javascript" src="<?php echo "$max_domain"; ?>/libs/php/editor/editor.js?version=4.1"></script>				
				<script language="JavaScript" type="text/javascript">
					var getdata =document.getElementById("content").value;
					Instantiate("max","editor", getdata , "100%", "300px");

					function get_hoteditor_data(){
						setCodeOutput();
						var bbcode_output=document.getElementById("hoteditor_bbcode_ouput_editor").value;//Output to BBCode
						document.getElementById("content").value = bbcode_output;
						document.form1.submit();
					}					
				</script>
                <!--//Editor END -->
							<!-- Icons area -->
                            <div class="spacer">&nbsp;</div>
							<table class="forum-jump full-border" id="icons-s" cellpadding="0" cellspacing="0">
								<tr>
									<td width="100%" class="fieldset">
										<div class="title_tag"><?php echo $lang['newpost_title_tag']; ?></div>
										<span id="tag_add"><input type="text" class="bginputs" name="taglist" id="tag_add_input" value="" size="40" tabindex="1" /></span>
										<div class="title_tag"><?php echo $lang['newpost_description_tag']; ?></div>
									</td>
								</tr>
							</table>
							<!-- Icons area -->
                            <div class="spacer">&nbsp;</div>
							<table class="forum-jump full-border" id="icons-s" cellpadding="0" cellspacing="0">
								<tr>
									<td colspan="13"><div style="margin:4px 3px 4px 0px"><?php echo $lang['newpost_icons']; ?></div></td>
								</tr>
								<tr>
									<td width="12%" nowrap="nowrap"><input type="radio" name="iconid" value="0" id="rb_iconid_0" tabindex="1" onclick="swap_posticon(null)" checked="checked" /><?php echo $lang['newpost_none_icon']; ?> &nbsp; &nbsp;</td>
									<td><input type="radio" name="iconid" value="1" id="rb_iconid_1" tabindex="1" onclick="swap_posticon('pi_1')"  /></td>
									<td width="12%"><img src="<?php echo $max_domain; ?>/images/icons/1.gif" alt="Post" id="pi_1" onclick="rb_iconid_1.click()" /></td>
									<td><input type="radio" name="iconid" value="2" id="rb_iconid_13" tabindex="1" onclick="swap_posticon('pi_13')"  /></td>
									<td width="12%"><img src="<?php echo $max_domain; ?>/images/icons/2.gif" alt="Thumbs down" id="pi_13" onclick="rb_iconid_13.click()" /></td>
									<td><input type="radio" name="iconid" value="3" id="rb_iconid_12" tabindex="1" onclick="swap_posticon('pi_12')"  /></td>
									<td width="12%"><img src="<?php echo $max_domain; ?>/images/icons/3.gif" alt="Wink" id="pi_12" onclick="rb_iconid_12.click()" /></td>
									<td><input type="radio" name="iconid" value="4" id="rb_iconid_11" tabindex="1" onclick="swap_posticon('pi_11')"  /></td>
									<td width="12%"><img src="<?php echo $max_domain; ?>/images/icons/4.gif" alt="Red face" id="pi_11" onclick="rb_iconid_11.click()" /></td>
									<td><input type="radio" name="iconid" value="5" id="rb_iconid_10" tabindex="1" onclick="swap_posticon('pi_10')"  /></td>
									<td width="12%"><img src="<?php echo $max_domain; ?>/images/icons/5.gif" alt="Talking" id="pi_10" onclick="rb_iconid_10.click()" /></td>
									<td><input type="radio" name="iconid" value="6" id="rb_iconid_9" tabindex="1" onclick="swap_posticon('pi_9')"  /></td>
									<td width="12%"><img src="<?php echo $max_domain; ?>/images/icons/6.gif" alt="Unhappy" id="pi_9" onclick="rb_iconid_9.click()" /></td>
								</tr>
								<tr>
									<td>&nbsp;</td>
									<td><input type="radio" name="iconid" value="7" id="rb_iconid_7" tabindex="1" onclick="swap_posticon('pi_7')"  /></td>
									<td width="12%"><img src="<?php echo $max_domain; ?>/images/icons/7.gif" alt="Smile" id="pi_7" onclick="rb_iconid_7.click()" /></td>
									<td><input type="radio" name="iconid" value="8" id="rb_iconid_6" tabindex="1" onclick="swap_posticon('pi_6')"  /></td>
									<td width="12%"><img src="<?php echo $max_domain; ?>/images/icons/8.gif" alt="Cool" id="pi_6" onclick="rb_iconid_6.click()" /></td>
									<td><input type="radio" name="iconid" value="9" id="rb_iconid_5" tabindex="1" onclick="swap_posticon('pi_5')"  /></td>
									<td width="12%"><img src="<?php echo $max_domain; ?>/images/icons/9.gif" alt="Question" id="pi_5" onclick="rb_iconid_5.click()" /></td>
									<td><input type="radio" name="iconid" value="10" id="rb_iconid_4" tabindex="1" onclick="swap_posticon('pi_4')"  /></td>
									<td width="12%"><img src="<?php echo $max_domain; ?>/images/icons/10.gif" alt="Exclamation" id="pi_4" onclick="rb_iconid_4.click()" /></td>
									<td><input type="radio" name="iconid" value="11" id="rb_iconid_3" tabindex="1" onclick="swap_posticon('pi_3')"  /></td>
									<td width="12%"><img src="<?php echo $max_domain; ?>/images/icons/11.gif" alt="Lightbulb" id="pi_3" onclick="rb_iconid_3.click()" /></td>
									<td><input type="radio" name="iconid" value="12" id="rb_iconid_2" tabindex="1" onclick="swap_posticon('pi_2')"  /></td>
									<td width="12%"><img src="<?php echo $max_domain; ?>/images/icons/12.gif" alt="Arrow" id="pi_2" onclick="rb_iconid_2.click()" /></td>
								</tr>
							</table>
<?php if ($can_add_polls=='1'){ ?>
							<!-- polls area -->
                            <div class="spacer">&nbsp;</div>
							<table class="forum-jump full-border" cellpadding="0" cellspacing="0">
								<tr><td class="forum-jump-content">
									<img  src="<?php echo "$poll_icon_img"; ?>" alt="" /> <a href="javascript: showhide('addpoll');" style="font-size: 11px;"><?php echo $lang['newpost_poll']; ?></a>
									<div id="addpoll" style="display: none;">
										<br />
										<table style="width: 100%;">
											<tr>
												<td><strong><?php echo $lang['edit_poll_question']; ?></strong></td>
												<td><input type="text" name="question" size="50" value="" /></td>
											</tr>
											<tr>
												<td><?php echo $lang['edit_poll_option1']; ?></td>
												<td><input type="text" name="option1" size="50" value="" /></td>
											</tr>
											<tr>
												<td><?php echo $lang['edit_poll_option2']; ?></td>
												<td><input type="text" name="option2" size="50" value="" /></td>
											</tr>
											<tr>
												<td><?php echo $lang['edit_poll_option3']; ?></td>
												<td><input type="text" name="option3" size="50" value="" /></td>
											</tr>
											<tr>
												<td><?php echo $lang['edit_poll_option4']; ?></td>
												<td><input type="text" name="option4" size="50" value="" /></td>
											</tr>
											<tr>
												<td><?php echo $lang['edit_poll_option5']; ?></td>
												<td><input type="text" name="option5" size="50" value="" /></td>
											</tr>
											<tr>
												<td><?php echo $lang['edit_poll_option6']; ?></td>
												<td><input type="text" name="option6" size="50" value="" /></td>
											</tr>
											<tr>
												<td><?php echo $lang['edit_poll_option7']; ?></td>
												<td><input type="text" name="option7" size="50" value="" /></td>
											</tr>
											<tr>
												<td><?php echo $lang['edit_poll_option8']; ?></td>
												<td><input type="text" name="option8" size="50" value="" /></td>
											</tr>
											<tr>
												<td><?php echo $lang['edit_poll_option9']; ?></td>
												<td><input type="text" name="option9" size="50" value="" /></td>
											</tr>
											<tr>
												<td><?php echo $lang['edit_poll_option10']; ?></td>
												<td><input type="text" name="option10" size="50" value="" /></td>
											</tr>
                                            <tr>
												<td><?php echo $lang['edit_poll_multiple']; ?></td>
												<td><input type="checkbox" class="checkbox" name="multiple" value="1" /></td>
											</tr>
										</table>
									</div>
								</td></tr>
							</table>

<?php } ?>
<?php }elseif ($template_hook=='3'){ ?>
							<!-- prepare attachments area -->
							<div class="spacer">&nbsp;</div>
							<table class="forum-jump" cellpadding="0" cellspacing="0">
								<tr><td class="forum-jump-content full-border">
									<img  src="<?php echo "$zip_icon_img"; ?>" alt="" /> <?php echo $lang['edit_file']; ?>
									<div id="file">
<?php }elseif ($template_hook=='4'){ ?>
										<!-- show upload form -->
										<object id="uploadframe" standby="Loading..." data="<?php echo "$max_domain"; ?>/uploads/upload.php?topicid=<?php echo "$new_topic"; ?>&attachtype=attachments&member=<?php echo "$uploader_id"; ?>&hash=<?php echo "$hash"; ?>" type="text/html" class="attachment-jump"></object>
									</div>
								</td></tr>
							</table>
<?php }elseif ($template_hook=='5'){ ?>
							<!-- final options and close form -->
							<div class="spacer">&nbsp;</div>
							<table class="forum-jump" cellpadding="0" cellspacing="0">
								<tr><td class="forum-jump-content full-border h_right">
<?php if ($can_sticky_topics=='1'){ ?>
									<strong><?php echo $lang['edit_sticky']; ?></strong>
									<input type="checkbox" class="checkbox f_right" name="sticky" value="1" tabindex="4"><br />
<?php }else{ ?>
									<input type="hidden" name="sticky" value="0" />
<?php }if ($can_global_announce=='1'){ ?>
									<strong><?php echo $lang['edit_announce']; ?></strong>
									<input type="checkbox" class="checkbox f_right" name="announce" value="1" tabindex="5"><br />
<?php }else{ ?>
									<input type="hidden" name="announce" value="0" />
<?php }if ($can_lock_topics=='1'){ ?>
									<strong><?php echo $lang['edit_lock']; ?></strong>
									<input type="checkbox" class="checkbox f_right" name="locked" value="1" tabindex="6">
<?php }else{ ?>
									<input type="hidden" name="locked" value="0" />
<?php } ?>
								</td></tr>
							</table>
							<input type="hidden" name="forum" value="<?php echo "$forum"; ?>" />
							<input type="hidden" name="hash" value="<?php echo "$hash"; ?>" />
							<div class="spacer">&nbsp;</div>
							<div class="f_left">
<?php if ($can_add_topics=='1'){ ?>
							<input type="hidden" name="token_id" value="<?php echo "$token_id"; ?>" />
							<input type="hidden" name="<?php echo "$token_name"; ?>" value="<?php echo "$token"; ?>" />
<?php } ?>
<?php if ($moderated=='0'){ ?>
							<input type="submit" class="img-submit" onclick="get_hoteditor_data()" value="<?php echo $lang['button_submit']; ?>" tabindex="7" />
<?php }else{ ?>
							<input type="submit" class="img-submit" value="<?php echo $lang['button_submit']; ?>" tabindex="7" onclick="javascript:return confirm('<?php echo $lang['topic_approve_warn']; ?>'); get_hoteditor_data();" />
<?php } ?>
						</form>
						<form name="preview" action="<?php echo "$max_domain"; ?>/includes/forums/preview.php" method="post" target="preview">
							<input type="hidden" name="content" />
							<input type="hidden" name="subject" />
							<input type="submit" class="img-submit" name="preview" value="<?php echo $lang['button_preview']; ?>" onclick="copydata()" tabindex="8" />
						</form>
						</div>
					</div>
				</td>
			</tr>
		</table>
		<table class="forum-index-forum-footer" cellpadding="0" cellspacing="0">
			<tr><td class="forum-index-forum-footer-contents"> </td></tr>
		</table>
		<script language="javascript">
			function copydata() {
				setCodeOutput();
				var bbcode_output=document.getElementById("hoteditor_bbcode_ouput_editor").value;//Output to BBCode
				document.getElementById("content").value = bbcode_output;
				document.preview.content.value = document.postcontent.content.value;
				document.preview.subject.value = document.postcontent.subject.value;
				window.open('<?php echo "$max_domain"; ?>/includes/forums/preview.php', 'preview', 'height=400,width=700,scrollbars=yes');
			}
		</script>
<?php }elseif ($template_hook=='form'){ ?>
	
<?php }elseif ($template_hook=='end'){ ?>
<?php } ?>
